package ac.github.os.internal.core.action.location.particle

import ac.github.os.internal.core.config.StringConfig
import ac.github.os.internal.core.config.get
import ac.github.os.internal.session.Cache
import ac.github.os.internal.session.Session
import sun.audio.AudioPlayer.player
import taboolib.common.platform.Awake
import taboolib.module.effect.Arc
import taboolib.module.effect.Matrixs


@Awake
class ArcParticle : IParticleAction() {

    override val particleName: String
        get() = "arc"

    override fun onExecute(session: Session, cache: Cache, config: StringConfig) {
        val angle = config.angle()
        val step = config.step()
        val radius = config.radius()
        val spawner = config.spawner()
        val start = config.get("start", 0.0)!!
        cache.filterIsLocation().forEach {
            Arc(it.adapt(),start, angle, radius, step,0, spawner).inject(config).show()
        }

    }
}